package com.lipeng.service.impl;

import com.lipeng.bean.Comment;
import com.lipeng.bean.Photo;
import com.lipeng.mapper.CommentMapper;
import com.lipeng.mapper.PhotoMapper;
import com.lipeng.service.CommentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by dllo on 18/3/8.
 */
@Service
public class CommentServiceImpl implements CommentService {
    @Resource
    private CommentMapper commentMapper;

    @Override
    public List<Comment> findAllComment() {
        return commentMapper.findAllComment();
    }

    @Override
    public Comment selectCommentById(Integer comid) {
        return commentMapper.selectByPrimaryKey(comid);
    }

    @Override
    public int deleteCommentById(Integer comid) {
        return commentMapper.deleteByPrimaryKey(comid);
    }

    @Override
    public List<Comment> selectCommentByContent(String content) {
        return commentMapper.selectCommentByContent(content);
    }

    @Override
    public int delCommentByPid(Integer pid) {
        return commentMapper.delCommentByPid(pid);
    }

    @Override
    public int addComment(Comment comment) {
        return commentMapper.insert(comment);
    }


}
